{% extends "base.html" %}
{% block title %}
站内消息 - 发消息
{% endblock %}


{% block ext_js_head %}
<script>
function sendMessage(){
	document.getElementById("action").value = "send";
	document.msform.submit();
}

function saveMessage() {
 	document.getElementById("action").value = "save";
	document.msform.submit();
}


    </script>
{% endblock %}

{% block breadcrumb %}
        <div class="breadcrumb">
<span><a href="/">首页</a></span>&gt;
<span><a href="/space/{{user.id}}/">个人中心</a></span>&gt;
<span id="breadcurrent"><a>发消息</a></span>
        </div>
{% endblock %}

{% block layoutmid_content %}
		<div id="content">
			<div id="content_list">
<ul id="second_nav" class="nav inline">
<li>写信件</li>
<li>|</li>
<li><a href="/msgbox/inbox">我的信箱</a></li>
<li>|</li>
<li><a href="/msgbox/outbox">已寄出信件</a></li>
</ul>

<div class="space_assets">
	<form name="msform" id="msform" action="" method="post">
	<input id="action" name="action" value="" type="hidden">
<ul class="nav">
<li>
	<div>收信人：</div>
	{% if to_user %}
	{{to_user.username}}
	<input id="id_rec_user" name="rec_user" value="{{to_user.id}}" type="hidden">
	{% else %}
	{{form.rec_user}}
	{% endif %}
	{% if form.rec_user.errors %}<span style="color: #FF0000;"> *** {{ form.rec_user.errors|join:", " }}</span>{% endif %} 
</li>
<li>
	<div>主题：</div>
	{{form.title}}
	{% if form.title.errors %}<span style="color: #FF0000;"> *** {{ form.title.errors|join:", " }}</span>{% endif %} 
</li>
<li>
	<div>内容：</div>
	{{form.content}}
	{% if form.content.errors %}<span style="color: #FF0000;"> *** {{ form.content.errors|join:", " }}</span>{% endif %} 
</li>
</ul>
<div class="submit">
<a href="" name="send" class="btn " onclick="sendMessage(); return false;">发送</a>
{% if xxxx %}
<a href="" name="save" class="btn btn-info" onclick="saveMessage(); return false;">保存</a>
{% endif %}
 <a class="btn btn-warning" href="javascript:history.back()">返回前一页</a>		</div>
	</form>
</div>

			</div>
		</div>
{% endblock %}